package com.neiquan.backstage.event.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neiquan.backstage.common.util.ExtraSpringHibernateTemplate;
import com.neiquan.backstage.pub.bsc.dao.po.EventProposer;

@Controller
@RequestMapping(value = "eventApply", produces = { "text/json;charset=UTF-8" })
public class EventAction {
	@Autowired
	private ExtraSpringHibernateTemplate extraSpringHibernateTemplate;

	/**
	 * 添加报名信息
	 */
	@RequestMapping(value = { "add" })
	public String add(Integer eventId, Integer memberId ,String name, String companyName, String phone) {
		EventProposer entity = new EventProposer();
		entity.setEventId(eventId);
		entity.setName(name);
		entity.setPhone(phone);
		entity.setDtCreat(System.currentTimeMillis());
		entity.setCompanyName(companyName);
		entity.setMemberId(memberId);
		extraSpringHibernateTemplate.getHibernateTemplate().save(entity);
		return "redirect:../../event_list.jsp?memberId="+memberId;
	}
}
